package com.af.data.stuct;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.List;

/**
 * @author : zhenyun.su
 * @comment : 配合ng-alain 联级控件ng-cascader，而定义对象
 * @since : 2022/4/22
 */

public class AfValueLabelTree implements Serializable {
    private String value;
    private String label;
    private List<AfValueLabelTree> children;
    @JsonProperty("isLeaf")
    private Boolean leaf;

    public static AfValueLabelTree of(String value, String label, List<AfValueLabelTree> valueLabelTrees, Boolean isLeaf){
        AfValueLabelTree ngCascader =  new AfValueLabelTree();
        ngCascader.setValue(value);
        ngCascader.setLabel(label);
        ngCascader.setChildren(valueLabelTrees);
        ngCascader.setLeaf(isLeaf);
        return ngCascader;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<AfValueLabelTree> getChildren() {
        return children;
    }

    public void setChildren(List<AfValueLabelTree> children) {
        this.children = children;
    }

    public Boolean getLeaf() {
        return leaf;
    }

    public void setLeaf(Boolean leaf) {
        this.leaf = leaf;
    }
}
